package com.financial.business.controller;

import com.financial.business.service.HeemoneyBusinessService;
import com.financial.business.util.apiresult.ApiResult;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.RestController;

/**
 * @author WANGNING
 * @api {post}
 * @email wyn20140226@aliyun.com
 * @tar 银盛业务处理
 * @date 2019/11/5 9:03
 * @apiGroup ys-business
 * @apiVersion 2.0.0
 * @apiHeader {String} null 无
 * @apiParam {String} requestJson 参数传递
 * @apiSuccess {String} succeed 就绪
 */
@RestController
@RequestMapping("/heemoney")
public class HeemoneyBusinessController {
    @Autowired
    private HeemoneyBusinessService heemoneyBusinessService;
    /**
     *
     *
     * @author zhaopengjun
     * @date 2019/12/11 15:17
     * @param [requestParam]
     * @return com.financial.business.util.apiresult.ApiResult
     */
    @RequestMapping(value = {"/merchRegister"}, produces = {"text/html;charset=UTF-8"}, method = {
            RequestMethod.POST})
    public ApiResult merchRegister(@RequestBody String requestParam) {

        return heemoneyBusinessService.merchRegister(requestParam);
    }


    /**
     * 汇收银商户报备进件
     *
     * @param requestParam
     * @return
     */
    @RequestMapping(value = {"/report"}, produces = {"text/html;charset=UTF-8"}, method = {
            RequestMethod.POST})
    public ApiResult report(@RequestBody String requestParam) {

        return heemoneyBusinessService.report(requestParam);
    }

    /**
     * 银盛支付
     *
     * @param requestParam
     * @return
     */
    @RequestMapping(value = {"/pay"}, produces = {"text/html;charset=UTF-8"}, method = {
            RequestMethod.POST})
    public ApiResult pay(@RequestBody String requestParam) {

        return heemoneyBusinessService.pay(requestParam);
    }

    /**
     * 银盛分账
     *
     * @param requestParam
     * @return
     */
    @RequestMapping(value = {"/split"}, produces = {"text/html;charset=UTF-8"}, method = {
            RequestMethod.POST})
    public ApiResult split(@RequestBody String requestParam) {

        return heemoneyBusinessService.split(requestParam);
    }

    /**
     * 银盛提现
     *
     * @param requestParam
     * @return
     */
    @RequestMapping(value = {"/withdrawal"}, produces = {"text/html;charset=UTF-8"}, method = {
            RequestMethod.POST})
    public ApiResult withdrawal(@RequestBody String requestParam) {

        return heemoneyBusinessService.withdrawal(requestParam);
    }

    /**
     * 银盛退款
     *
     * @param requestParam
     * @return
     */
    @RequestMapping(value = {"/refund"}, produces = {"text/html;charset=UTF-8"}, method = {
            RequestMethod.POST})
    public ApiResult refund(@RequestBody String requestParam) {

        return heemoneyBusinessService.refund(requestParam);
    }

    /**
     * 银盛代付/转账
     *
     * @param requestParam
     * @return
     */
    @RequestMapping(value = {"/payment"}, produces = {"text/html;charset=UTF-8"}, method = {
            RequestMethod.POST})
    public ApiResult payment(@RequestBody String requestParam) {

        return heemoneyBusinessService.payment(requestParam);
    }
}
